#define _CRT_SECURE_NO_WARNINGS  1
#include"Sort.h"
#include"Stack.h"

void TestInsertSort()
{
	//int arr[] = { 1,8,3,5,6,4,9,2,0,7 };
	int arr[] = { 22,5,12,3,2,2,7,1,8,2,5,9,0,3,9,8,7,3,1,0,6,0,9,1,4 };
	InsertSort(arr, sizeof(arr) / sizeof(int));
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestShellSort()
{
	//int arr[] = { 1,8,3,5,6,4,9,2,0,7 };
	int arr[] = { 22,5,12,3,2,2,7,1,8,2,5,9,0,3,9,8,7,3,1,0,6,0,9,1,4 };
	ShellSort(arr, sizeof(arr) / sizeof(int));
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestSelectSort()
{
	//int arr[] = { 1,8,3,5,6,4,9,2,0,7 };
	int arr[] = { 22,5,12,3,2,2,7,1,8,2,5,9,0,3,9,8,7,3,1,0,6,0,9,1,4 };
	SelectSort(arr, sizeof(arr) / sizeof(int));
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestHeapSort()
{
	int arr[] = { 1,8,3,5,6,4,9,2,0,7 };
	//int arr[] = { 22,5,12,3,2,2,7,1,8,2,5,9,0,3,9,8,7,3,1,0,6,0,9,1,4 };
	HeapSort(arr, sizeof(arr) / sizeof(int));
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestBubbleSort()
{
	//int arr[] = { 1,8,3,5,6,4,9,2,0,7 };
	int arr[] = { 22,5,12,3,2,2,7,1,8,2,5,9,0,3,9,8,7,3,1,0,6,0,9,1,4 };
	BubbleSort(arr, sizeof(arr) / sizeof(int));
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestQuickSort()
{
	//int arr[] = { 1,8,3,5,6,8,2,7 };
	int arr[] = { 22,5,12,3,26,0,9,1,4 };
	QuickSort(arr, 0,sizeof(arr) / sizeof(int)-1);
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestQuickSortNonR()
{
	//int arr[] = { 1,8,3,5,6,4,9,2,0,7 };
	int arr[] = { 22,1,8,3,5,6,4,9,2,0,75,12,3,26,0,9,1,4,22,5,12,3,2,2,7,1,8,2,5,9,0,3,9,8,7,3,1,0,6,0,9,1,4 };
	QuickSortNonR(arr, 0, sizeof(arr) / sizeof(int) - 1);
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestMergeSort()
{
	//int arr[] = { 8,1,5,3,6,4,9,2,0,7 };
	int arr[] = { 22,1,8,3,5,6,4,9,2,0,9,1,4,22,5,12,3,2,2,7,1,8,2,5,9,0,3,9,8,7,3,1,5,9,0,3,9,8,7,3,1,5,9,0,3,9,8,7,3,1,5,9,0,3,9,8,7,3,1,5,9,0,3,9,8,7,3,1,0,6,0,9,1,4 };
	MergeSort(arr, 0, sizeof(arr) / sizeof(int) - 1);
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestMergeSortNonR()
{
	//int arr[] = { 1,8,3,5,6,4,9,2,0,7};
	int arr[] = { 0,6,0,9,8,3,5,6,4,9,2,0 };
	MergeSortNonR(arr, 0, sizeof(arr) / sizeof(int) - 1);
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

void TestCountSort()
{
	//int arr[] = { 1,8,3,5,6,4,9,2,0,7};
	int arr[] = { 222,1,8,3,5,6,4,9,2,0,9,1,4,22,5,12,3,2,2,7,1,8,2,5,9,0,3,9,8,7,3,1,5,9,0,3,9,8,7,3,1,5,9,0,3,9,8,7,3,1,5,9,0,3,9,8,7,3,1,5,9,0,3,9,8,7,3,1,0,6,0,9,1,4 };
	CountSort(arr,sizeof(arr)/sizeof(int));
	ArrPrint(arr, sizeof(arr) / sizeof(int));
}

int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestSelectSort();
	//TestHeapSort();
	//TestBubbleSort();
	//TestQuickSort();
	//TestQuickSortNonR();
	//TestMergeSort();
	//TestMergeSortNonR();
	TestCountSort();

	return 0;
}